class Footer {
  mixin = {
    data() {
      return {
        footerList: [{
            title: "FQA",
            show: false,
            icon: "question-o",
            actions: [{
              title: 'FQA',
              url: "/other/fqa"
            }, {
              title: 'Registration and login',
              url: "/other/fqa/registerlogin"
            }, {
              title: 'National services',
              url: "/other/fqa/servercount"
            }, {
              title: 'makeup oem',
              url: "/other/fqa/makeupoem"
            }, ]
          },
          {
            title: "DELIVERY AND ORDER",
            show: false,
            icon: "orders-o",
            actions: [{
                title: 'SHIPPING',
                url: "/other/deliorder/shipping"
              }, {
                title: 'ORDERING',
                url: "/other/deliorder/ordering"
              }, {
                title: 'Returns',
                url: "/other/deliorder/returns"
              }, {
                title: 'tracking number',
                url: "https://www.17track.net/en",
                outer: true,
              },
              {
                title: 'payment method',
                url: "/other/deliorder/paymethod"
              },
            ]
          },
          {
            title: "CLAUSE",
            show: false,
            icon: "service-o",
            actions: [{
              title: 'Terms and conditions',
              url: "/other/clauser/terms"
            }, {
              title: 'Privacy policy',
              url: "/other/clauser/privacy"
            }]
          },
          {
            title: "ABOUT",
            show: false,
            icon: "friends-o",
            actions: [{
              title: 'About Us',
              url: "/other/about/aboutus"
            }, {
              title: 'contact us',
              url: "/other/about/contactus"
            }, {
              title: 'Promotion Alliance',
              url: "/other/about/promotion"
            }, {
              title: 'Membership rules',
              url: "/other/about/member"
            }, {
              title: 'Ranking List',
              url: "/other/about/rank"
            }]
          },
        ],
        email: ""
      }
    },
    computed: {
      shareList() {
        return this.$store.state.over.shareList;
      }
    },
    methods: {
      //点击问题
      clickCell(fooIndex, acindex) {
        this.moreModel = false;
        this.footerList[fooIndex].show = false;
        let url = this.footerList[fooIndex].actions[acindex].url;
        let outer = this.footerList[fooIndex].actions[acindex].outer == undefined ? false : this.footerList[fooIndex].actions[acindex].outer;
        if (outer) {
          location.href = url;
        } else {
          this.$router.push({
            path: url,
          });
        }
      },
      //点击分享
      clickShare(item) {
        // let url = item.url + "&href=" + location.href + "&redirect_uri=" + location.href;
        // console.log(url);
      },
      //点击订阅
      async clickSubscribe() {
        let reg = /^([a-zA-Z0-9]+[_|\_|\.]?)*[a-zA-Z0-9]+@([a-zA-Z0-9]+[_|\_|\.]?)*[a-zA-Z0-9]+\.[a-zA-Z]{2,3}$/;
        let bool = reg.test(this.email);
        if (this.email == "") {
          this.$toast("Please input email")
        } else if (!bool) {
          this.$toast("Please enter the correct email address")
        } else {
          let res = await this.$store.dispatch("over/subscribe", {
            email: this.email
          });
          if (res.code == 0) {
            this.$toast("Subscription succeeded")
          } else {
            this.$toast.fail(res.msg);
          }
        }
      }
    }
  }
}
export default new Footer();
